Integrand size = 29, antiderivative size = 69 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx=\frac {a \text {arctanh}(\sin (e+f x))}{d f}-\frac {2 a \sqrt {c-d} \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{d \sqrt {c+d} f} \]
a*arctanh(sin(f*x+e))/d/f-2*a*arctanh((c-d)^(1/2)*tan(1/2*f*x+1/2*e)/(c+d) ^(1/2))*(c-d)^(1/2)/d/f/(c+d)^(1/2)
Time = 0.76 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.55 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx=\frac {a \left (\frac {2 (c-d) \text {arctanh}\left (\frac {(-c+d) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\sqrt {c^2-d^2}}-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{d f} \]
(a*((2*(c - d)*ArcTanh[((-c + d)*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/Sqrt[ c^2 - d^2] - Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + Log[Cos[(e + f*x)/ 2] + Sin[(e + f*x)/2]]))/(d*f)
Time = 0.49 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {3042, 4486, 3042, 4257, 4318, 3042, 3138, 221}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec (e+f x) (a \sec (e+f x)+a)}{c+d \sec (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right ) \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )}{c+d \csc \left (e+f x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4486 |
\(\displaystyle \frac {a \int \sec (e+f x)dx}{d}-\frac {a (c-d) \int \frac {\sec (e+f x)}{c+d \sec (e+f x)}dx}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \int \csc \left (e+f x+\frac {\pi }{2}\right )dx}{d}-\frac {a (c-d) \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right )}{c+d \csc \left (e+f x+\frac {\pi }{2}\right )}dx}{d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {a \text {arctanh}(\sin (e+f x))}{d f}-\frac {a (c-d) \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right )}{c+d \csc \left (e+f x+\frac {\pi }{2}\right )}dx}{d}\) |
\(\Big \downarrow \) 4318 |
\(\displaystyle \frac {a \text {arctanh}(\sin (e+f x))}{d f}-\frac {a (c-d) \int \frac {1}{\frac {c \cos (e+f x)}{d}+1}dx}{d^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \text {arctanh}(\sin (e+f x))}{d f}-\frac {a (c-d) \int \frac {1}{\frac {c \sin \left (e+f x+\frac {\pi }{2}\right )}{d}+1}dx}{d^2}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {a \text {arctanh}(\sin (e+f x))}{d f}-\frac {2 a (c-d) \int \frac {1}{\left (1-\frac {c}{d}\right ) \tan ^2\left (\frac {1}{2} (e+f x)\right )+\frac {c+d}{d}}d\tan \left (\frac {1}{2} (e+f x)\right )}{d^2 f}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {a \text {arctanh}(\sin (e+f x))}{d f}-\frac {2 a \sqrt {c-d} \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{d f \sqrt {c+d}}\) |
(a*ArcTanh[Sin[e + f*x]])/(d*f) - (2*a*Sqrt[c - d]*ArcTanh[(Sqrt[c - d]*Ta n[(e + f*x)/2])/Sqrt[c + d]])/(d*Sqrt[c + d]*f)
3.2.89.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo l] :> Simp[1/b Int[1/(1 + (a/b)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[( e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[B/b Int[Csc[e + f*x], x], x] + Simp[(A*b - a*B)/b Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x ] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]
Time = 0.72 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.30
method | result | size |
derivativedivides | \(\frac {4 a \left (-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4 d}-\frac {\left (c -d \right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{2 d \sqrt {\left (c +d \right ) \left (c -d \right )}}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4 d}\right )}{f}\) | \(90\) |
default | \(\frac {4 a \left (-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4 d}-\frac {\left (c -d \right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{2 d \sqrt {\left (c +d \right ) \left (c -d \right )}}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4 d}\right )}{f}\) | \(90\) |
risch | \(\frac {\sqrt {\left (c +d \right ) \left (c -d \right )}\, a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}-d}{c}\right )}{\left (c +d \right ) f d}-\frac {\sqrt {\left (c +d \right ) \left (c -d \right )}\, a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {\left (c +d \right ) \left (c -d \right )}+d}{c}\right )}{\left (c +d \right ) f d}+\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{d f}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{d f}\) | \(159\) |
4/f*a*(-1/4/d*ln(tan(1/2*f*x+1/2*e)-1)-1/2*(c-d)/d/((c+d)*(c-d))^(1/2)*arc tanh((c-d)*tan(1/2*f*x+1/2*e)/((c+d)*(c-d))^(1/2))+1/4/d*ln(tan(1/2*f*x+1/ 2*e)+1))
Time = 0.31 (sec) , antiderivative size = 255, normalized size of antiderivative = 3.70 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx=\left [\frac {a \sqrt {\frac {c - d}{c + d}} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (c^{2} + c d + {\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt {\frac {c - d}{c + d}} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) + a \log \left (\sin \left (f x + e\right ) + 1\right ) - a \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, d f}, -\frac {2 \, a \sqrt {-\frac {c - d}{c + d}} \arctan \left (-\frac {{\left (d \cos \left (f x + e\right ) + c\right )} \sqrt {-\frac {c - d}{c + d}}}{{\left (c - d\right )} \sin \left (f x + e\right )}\right ) - a \log \left (\sin \left (f x + e\right ) + 1\right ) + a \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, d f}\right ] \]
[1/2*(a*sqrt((c - d)/(c + d))*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos( f*x + e)^2 - 2*(c^2 + c*d + (c*d + d^2)*cos(f*x + e))*sqrt((c - d)/(c + d) )*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d ^2)) + a*log(sin(f*x + e) + 1) - a*log(-sin(f*x + e) + 1))/(d*f), -1/2*(2* a*sqrt(-(c - d)/(c + d))*arctan(-(d*cos(f*x + e) + c)*sqrt(-(c - d)/(c + d ))/((c - d)*sin(f*x + e))) - a*log(sin(f*x + e) + 1) + a*log(-sin(f*x + e) + 1))/(d*f)]
\[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx=a \left (\int \frac {\sec {\left (e + f x \right )}}{c + d \sec {\left (e + f x \right )}}\, dx + \int \frac {\sec ^{2}{\left (e + f x \right )}}{c + d \sec {\left (e + f x \right )}}\, dx\right ) \]
a*(Integral(sec(e + f*x)/(c + d*sec(e + f*x)), x) + Integral(sec(e + f*x)* *2/(c + d*sec(e + f*x)), x))
Exception generated. \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?` f or more de
Leaf count of result is larger than twice the leaf count of optimal. 127 vs. \(2 (60) = 120\).
Time = 0.33 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.84 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx=\frac {\frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{d} - \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{d} + \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )} {\left (a c - a d\right )}}{\sqrt {-c^{2} + d^{2}} d}}{f} \]
(a*log(abs(tan(1/2*f*x + 1/2*e) + 1))/d - a*log(abs(tan(1/2*f*x + 1/2*e) - 1))/d + 2*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*ta n(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d^2)))*(a*c - a*d )/(sqrt(-c^2 + d^2)*d))/f
Time = 13.83 (sec) , antiderivative size = 195, normalized size of antiderivative = 2.83 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c+d \sec (e+f x)} \, dx=\frac {2\,a\,\mathrm {atanh}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f\,\left (c+d\right )}+\frac {2\,a\,\left (\mathrm {atanh}\left (\frac {d^3\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-c^3\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,d^2\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-c^2\,d\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (c^2-d^2\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c^2-d^2}\,\left (d^2+c\,d\right )}\right )\,\sqrt {c^2-d^2}+c\,\mathrm {atanh}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\right )}{d\,f\,\left (c+d\right )} \]
(2*a*atanh(sin(e/2 + (f*x)/2)/cos(e/2 + (f*x)/2)))/(f*(c + d)) + (2*a*(ata nh((d^3*sin(e/2 + (f*x)/2) - c^3*sin(e/2 + (f*x)/2) + c*d^2*sin(e/2 + (f*x )/2) - c^2*d*sin(e/2 + (f*x)/2) + c*sin(e/2 + (f*x)/2)*(c^2 - d^2))/(cos(e /2 + (f*x)/2)*(c^2 - d^2)^(1/2)*(c*d + d^2)))*(c^2 - d^2)^(1/2) + c*atanh( sin(e/2 + (f*x)/2)/cos(e/2 + (f*x)/2))))/(d*f*(c + d))